index.js ➔ start   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
const master = require('./master')
2
const worker = require('./worker')
3
const defaultConfig = require('../config')
4
5
async function start ({ config, plugins }) {
6
  const setup = Object.assign({}, defaultConfig, config || {})
7
8
  if (setup.isMaster && setup.totalWorkers > 0) {
9
    master(setup)
10
  } else {
11
    await worker(setup, plugins)
12
  }
13
}
14
15
module.exports = start
16